/********************************************************************
	copyright (c) by TwT
    @created:	11/21/2011 11:19
    @filename: 	Configure
    @author:	Gu Yanbo (gybgdhb@gmail.com)
    @brief:	    
*********************************************************************/
namespace Configure{
#ifndef _CONFIGURE_H_
#define _CONFIGURE_H_

#include <string.h>

class Configure;
class FrameConfigure;
inline FrameConfigure* GetFrameConfigure();
inline Configure* GetConfigure();
class Configure{
protected:
	static Configure *m_Obj;	
public:

	static Configure* instance(){
		return m_Obj;
	}
	virtual void Setup(){};
	Configure(){
		this->Init();
	}
	~Configure(){
		this->Release();
	}
	virtual void Release(){};
	virtual void Init(){};
	static void SetObj(Configure* obj){
		m_Obj=obj;
	}

};
Configure* Configure::m_Obj=NULL;
inline Configure* GetConfigure(){
	return Configure::instance();
}

//Configure* Configure::m_Obj;

class FrameConfigure:public Configure{
public:
	FrameConfigure(){this->Init();};
	int GetW(){return width_;}
	int GetH(){return height_;}
	void SetW(int _width){width_=_width;}
	void SetH(int _height){height_=_height;}
	void SetDevice(char _device[]){strcpy(device_,_device);}
	char* GetDevice(){
		char* ch=(char*)malloc(sizeof(char)*20);
		strcpy(ch,device_);

		return ch;
	}
	int isFull(){return isFull_;}
	static void Setup(){

	}
	void Init(){
		width_=480;
		height_=720;
		isFull_=0;
		device_="dx9";


	}
private:
	int width_;
	int height_;
	int isFull_;
	char* device_;
};

inline FrameConfigure* GetFrameConfigure(){

	return (FrameConfigure*)FrameConfigure::instance();
}

#endif //_CONFIGURE_H_

}
//
//History:
//[11/21/2011] <gybgdhb@gmail.com> created
//////////////////////////////////////////////////////////////////////////